home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Gekkan Dennou Club 145
/
Gekkan Dennou Club - 2000.6 Vol. 145 (Japan).7z
/
Gekkan Dennou Club - 2000.6 Vol. 145 (Japan) (Track 1).bin
/
tools
/
sharp
/
sxwork3.lzh
/
サンプル応用編
/
イメージ編集
/
GIMAGE.H
< prev
next >
Wrap
Text File
|
1994-03-10
|
5KB
|
144 lines
/******************************************************************************
* gimage.h: gimage.c用ヘッダファイル
******************************************************************************
* Workroom SX-68K Sample Program Copyright 1994 SHARP
*
* 定数定義
*/
/* ウィンドウタイトル */
#define WINTITLE ((_LASCII) "\x0cイメージ編集")
/* ウィンドウサイズ */
#define WIN_H 480 /* ウィンドウの幅 */
#define WIN_V 256 /* ウィンドウの高さ */
/* 数値調整ボタンのリピート時間(1/100秒単位)*/
#define ADJFIRST 40 /* リピート開始時間 */
#define ADJNEXT 12 /* リピート間隔 */
/* サブウィンドウサイズ */
#define TLSUB_H 140 /* ツールウィンドウの幅 */
#define TLSUB_V 90 /* ツールウィンドウの高さ */
#define PLSUB_H 168 /* 色選択ウィンドウの幅 */
#define PLSUB_V 68 /* 色選択ウィンドウの高さ */
/* サブウィンドウの表示位置 */
#define TLPOS_X 150 /* ツールウィンドウの左端 */
#define TLPOS_Y 70 /* ツールウィンドウの上端 */
#define PLPOS_X 420 /* 色選択ウィンドウの左端 */
#define PLPOS_Y 70 /* 色選択ウィンドウの上端 */
/* 数値調整ボタンの表示位置 */
#define ADJ_X 56 /* X座標 */
#define ADJ_Y (WS_INSIDE_Y + 2) /* Y座標 */
/* サブウィンドウのパートコード */
#define WS_ININSIDE 3 /* サブウィンドウの内側 */
#define WS_INDRAG 4 /* ドラッグリージョン */
#define WS_INCLOSE 7 /* クローズボタン */
#define CLOSE -1 /* クローズボタン */
#define MAIN -1 /* メインウィンドウ */
#define TOOL 0 /* ツールウィンドウ */
#define PALET 1 /* 色選択ウィンドウ */
#define SUBMAX 2 /* サブウィンドウの数 */
/* ビットイメージリソースの開始ID */
#define BRSSTID 128 /* 'PAT2' */
#define BTNSTID 128 /* 'PAT3' */
#define COLSTID 128 /* 'PAT4' */
/* イベントマスク */
#define EVENTMASK (EM_MSLDOWN | EM_MSRDOWN | EM_UPDATE | EM_ACTIVATE | EM_SYSTEM1 | EM_SYSTEM2)
/*
* 構造体宣言
*/
typedef struct ComVal { /* 共通変数 */
Window *windowPtr; /* ウィンドウポインタ */
BOOLEAN activeFlag; /* アクティブフラグ */
TsEvent event; /* イベントレコード */
int eventMask; /* イベントマスク */
int errorCode; /* エラーコード */
BOOLEAN endFlag; /* 終了フラグ */
Subwin *subwinPtr[SUBMAX]; /* サブウィンドウポインタ */
Region **subRgnHdl[SUBMAX]; /* サブウィンドウのリージョンハンドル */
BOOLEAN subActiveFlag[SUBMAX]; /* サブウィンドウのアクティブフラグ */
/* ペン幅調整ボタンのコントロールハンドル */
Control **adjBtnHdl;
LASCII adjBtnTtl; /* ペン幅調整ボタンのタイトル */
Handle resMap; /* リソースマップのハンドル */
/* サブウィンドウのピクチャーボタン用ビットイメージ */
RectImg **pctBtnImg[13];
RectImg **brushImg[2]; /* ブラシ、消しゴム用ビットイメージ */
RectImg **plBtnImg; /* パレットボタン用ビットイメージ */
Graph offGraph; /* オフスクリーン用グラフレコード */
/* オフスクリーン用グラフ作成完了フラグ */
BOOLEAN offGraphOK;
Bits **offBitsHdl; /* オフスクリーン用ビッツハンドル */
Graph wkGraph; /* ワーク用グラフレコード */
BOOLEAN wkGraphOK; /* ワーク用グラフ作成完了フラグ */
Bits **wkBitsHdl; /* ワーク用ビッツハンドル */
int paletNo; /* パレット番号 */
int toolKind; /* 現在使用中のツールの種類 */
Point penSize; /* 描画ペンサイズ */
Point radius; /* ラウンドレクタングルの半径 */
} ComVal;
/*
* 外部変数宣言
*/
extern Rect brSize;
/*
* 関数プロトタイプ
*/
/* gimain.c */
BOOLEAN init(ComVal *);
BOOLEAN createWindow(ComVal *);
BOOLEAN createOffScreen(ComVal *);
void msLDownEvent(ComVal *);
void msRDownEvent(ComVal *);
void selectMenu(ComVal *);
void keyDownEvent(ComVal *);
void updateEvent(ComVal *);
void drawGraph(ComVal *);
void activateEvent(ComVal *);
void systemEvent(ComVal *);
void showErrDialog(ComVal *);
void endProc(int, ComVal *);
BOOLEAN loadResource(ComVal *);
void setGraph(ComVal *, int, int);
void repeatAdjBtn(ComVal *, int);
/* gimage.c */
void paintPen(ComVal *, LPoint);
void paintRgn(ComVal *, LPoint);
BOOLEAN makeRgn(ComVal *, Point *, int, Rect *);
void paintBrush(ComVal *, LPoint);
void brushing(ComVal *, Region **, Point *, Point *, Point *);
void drawEraser(ComVal *, Rect *);
void paintFig(ComVal *, LPoint);
void drawFig(ComVal *, Rect *);
void makeRect(LPoint, LPoint, Rect *);
void ajustPoint(Point *, Point *);
void ajustEndPoint(LPoint, Point *);
/* gisubwin.c */
BOOLEAN createSubwin(ComVal *);
BOOLEAN openSubwin(ComVal *, int);
void closeSubwin(ComVal *, int);
BOOLEAN createSubControl(ComVal *);
void checkSubControl(ComVal *);
int msLDownSubwin(ComVal *, int);
void dragSubwin(ComVal *, LPoint, int);
void drawSubwin(ComVal *, int);
void drawSubTitleBar(ComVal *, int);
void selectPctBtn(ComVal *, int);
void calcPctBtn(int, int, Rect *);
BOOLEAN checkPctBtn(ComVal *, int, int, LPoint);
void changePctBtn(ComVal *, int, int);
void revFillRect(Rect *);
void revFrameRect(Rect *);